package cn.com.dbridge.common.websocket.client;

import cn.com.dbridge.common.websocket.netty.handler.DeviceInfoManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * websocket 直接调用demo
 */
@RestController
@Slf4j
public class TestController {
    @GetMapping("/hello")
    public void hello() {
        log.info("this is a test");
        String str = "{\"body\":\"this is a json test demo\",\"extend\":{\"nick\":\"管理员\",\"uid\":1001,\"time\":\"10:54:35\"},\"uri\":1,\"version\":1}";
        DeviceInfoManager.broadcastMessage(0, "管理员", str);
    }
}
